/* styles.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --primary: #3498db;
    --secondary: #2ecc71;
    --accent: #e74c3c;
    --dark: #2c3e50;
    --light: #ecf0f1;
    --gray: #95a5a6;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --radius: 10px;
}

body {
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 15px 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.8rem;
    font-weight: bold;
}

.logo i {
    color: var(--light);
}

nav ul {
    display: flex;
    list-style: none;
    gap: 25px;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    padding: 8px 12px;
    border-radius: var(--radius);
}

nav a:hover, nav a.active {
    background: rgba(255, 255, 255, 0.2);
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-actions .btn {
    padding: 8px 16px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: white;
    color: var(--primary);
}

.btn-secondary {
    background-color: transparent;
    border: 2px solid white;
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 主要内容区域 */
.main-content {
    display: flex;
    gap: 30px;
    margin: 30px 0;
    flex: 1;
}

.content-area {
    flex: 3;
}

.sidebar {
    flex: 1;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 25px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body {
    padding: 20px;
}

/* 主页样式 */
.welcome-banner {
    background: linear-gradient(to right, var(--primary), var(--secondary));
    color: white;
    padding: 40px;
    text-align: center;
    border-radius: var(--radius);
    margin-bottom: 30px;
}

.welcome-banner h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.welcome-banner p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 25px;
}

.post {
    display: flex;
    gap: 20px;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.post:last-child {
    border-bottom: none;
}

.post-stats {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}

.post-stats .votes {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--gray);
}

.post-stats .comments {
    background: var(--light);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-top: 10px;
}

.post-content {
    flex: 1;
}

.post-title {
    font-size: 1.4rem;
    margin-bottom: 10px;
    color: var(--dark);
}

.post-meta {
    display: flex;
    gap: 15px;
    color: var(--gray);
    font-size: 0.9rem;
    margin: 15px 0;
}

.tags {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.tag {
    background: var(--light);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
}

.tag-training {
    background: #e1f5fe;
    color: #0288d1;
}

.tag-gear {
    background: #e8f5e9;
    color: #388e3c;
}

.tag-nutrition {
    background: #fff3e0;
    color: #ef6c00;
}

/* 写文章页面 */
.create-post {
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: var(--radius);
    font-size: 1rem;
}

textarea.form-control {
    min-height: 200px;
    resize: vertical;
}

.btn-submit {
    background: linear-gradient(to right, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1.1rem;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-submit:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

/* 注销页面 */
.logout-container {
    max-width: 600px;
    margin: 50px auto;
    text-align: center;
}

.logout-card {
    padding: 40px;
}

.logout-icon {
    font-size: 5rem;
    color: var(--accent);
    margin-bottom: 25px;
}

.logout-message {
    font-size: 1.5rem;
    margin-bottom: 30px;
    color: var(--dark);
}

/* 侧边栏样式 */
.sidebar-card {
    padding: 20px;
}

.sidebar-title {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background: var(--light);
    border-radius: var(--radius);
}

.stat-number {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 5px;
}

.stat-label {
    color: var(--gray);
    font-size: 0.9rem;
}

.topics-list {
    list-style: none;
}

.topics-list li {
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
}

.topics-list li:last-child {
    border-bottom: none;
}

.topic-count {
    background: var(--light);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* 页脚样式 */
footer {
    background: var(--dark);
    color: white;
    padding: 40px 0 20px;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-bottom: 30px;
}

.footer-column h3 {
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: white;
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #bdc3c7;
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 900px) {
    .main-content {
        flex-direction: column;
    }

    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    nav ul {
        display: none;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    .header-content {
        flex-wrap: wrap;
        gap: 15px;
    }

    .user-actions {
        width: 100%;
        justify-content: center;
    }
}
/* 文章详情页特有样式 */
.article-container {
    max-width: 900px;
    margin: 40px auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.article-header {
    padding: 40px 40px 20px;
    background: linear-gradient(to right, rgba(52, 152, 219, 0.05), rgba(46, 204, 113, 0.05));
    border-bottom: 1px solid #f0f4f8;
}

.article-title {
    font-size: 2.4rem;
    margin: 0 0 20px;
    color: #2c3e50;
    line-height: 1.3;
    font-weight: 700;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    margin: 25px 0 15px;
    color: #7f8c8d;
    font-size: 0.95rem;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3498db, #2ecc71);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.3rem;
}

.author-details {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1rem;
}

.article-stats {
    display: flex;
    gap: 25px;
    margin: 10px 0;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 7px;
}

.article-tags {
    display: flex;
    gap: 12px;
    margin: 25px 0 10px;
}

.tag {
    background: #f8f9fa;
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 0.92rem;
    font-weight: 500;
}

.tag-training {
    background: #e1f5fe;
    color: #0288d1;
}

.tag-gear {
    background: #e8f5e9;
    color: #388e3c;
}

.article-content {
    padding: 35px 40px;
    line-height: 1.85;
    font-size: 1.08rem;
    color: #34495e;
}

.article-content h2 {
    color: #3498db;
    margin: 35px 0 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f4f8;
    font-size: 1.7rem;
}

.article-content h3 {
    color: #2ecc71;
    margin: 28px 0 16px;
    font-size: 1.4rem;
}

.article-content p {
    margin-bottom: 20px;
}

.article-content img {
    max-width: 100%;
    border-radius: 10px;
    margin: 25px 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f4f8;
}

.article-content ul, .article-content ol {
    margin: 20px 0;
    padding-left: 30px;
}

.article-content li {
    margin-bottom: 12px;
    position: relative;
}

.article-content ul li:before {
    content: "•";
    color: #2ecc71;
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

.content-highlight {
    background: #f8f9fa;
    border-left: 4px solid #3498db;
    padding: 25px;
    margin: 30px 0;
    border-radius: 0 8px 8px 0;
}

.article-actions {
    display: flex;
    justify-content: center;
    gap: 25px;
    padding: 25px;
    border-top: 1px solid #f0f4f8;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 25px;
    border-radius: 30px;
    background: #f8f9fa;
    color: #2c3e50;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 1.05rem;
}

.action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.like-btn:hover {
    background: #ffeef0;
    color: #e74c3c;
}

.save-btn:hover {
    background: #e6f7ff;
    color: #3498db;
}

.share-btn:hover {
    background: #f0f9eb;
    color: #2ecc71;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .article-header, .article-content {
        padding: 25px;
    }

    .article-title {
        font-size: 1.9rem;
    }

    .article-meta {
        flex-direction: column;
        gap: 18px;
    }

    .article-stats {
        gap: 18px;
    }
}

@media (max-width: 480px) {
    .article-title {
        font-size: 1.7rem;
    }

    .article-actions {
        flex-wrap: wrap;
    }

    .article-content h2 {
        font-size: 1.5rem;
    }

    .article-content h3 {
        font-size: 1.25rem;
    }
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Noto Sans SC', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --primary: #3498db;
    --secondary: #2ecc71;
    --accent: #e74c3c;
    --dark: #2c3e50;
    --light: #ecf0f1;
    --gray: #95a5a6;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 6px 20px rgba(0, 0, 0, 0.15);
    --radius: 10px;
    --transition: all 0.3s ease;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: 40px;
}

/* 头部导航样式 */
header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 15px 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.8rem;
    font-weight: bold;
}

.logo i {
    color: var(--light);
    animation: pulse 2s infinite;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 25px;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1rem;
    transition: var(--transition);
    padding: 8px 12px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 8px;
}

nav a:hover, nav a.active {
    background: rgba(255, 255, 255, 0.2);
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.user-info i {
    font-size: 1.4rem;
}

.btn {
    padding: 8px 16px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.2);
    border: 1px solid white;
    color: white;
}

.btn-secondary:hover {
    background-color: white;
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* 内容编辑区域 */
.content-edit {
    max-width: 1200px;
    margin: 40px auto 0;
    padding: 0 20px;
    width: 100%;
}

.create-post-header {
    text-align: center;
    margin-bottom: 30px;
}

.create-post-header h1 {
    font-size: 2.5rem;
    color: var(--dark);
    margin-bottom: 10px;
    position: relative;
    display: inline-block;
}

.create-post-header h1:after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    border-radius: 2px;
}

.create-post-header p {
    color: var(--gray);
    font-size: 1.1rem;
    margin-top: 20px;
}

.push {
    margin-bottom: 25px;
}

#title {
    width: 100%;
    padding: 20px;
    font-size: 1.8rem;
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    background: white;
    color: var(--dark);
    transition: var(--transition);
    border-left: 4px solid var(--primary);
}

#title:focus {
    outline: none;
    box-shadow: var(--shadow-hover);
    border-left: 4px solid var(--secondary);
}

#title::placeholder {
    color: #bbb;
    font-weight: 300;
}

.form-group {
    margin: 25px 0;
}

.form-group label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

#post-category {
    width: 100%;
    padding: 15px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    box-shadow: var(--shadow);
    background: white;
    color: var(--dark);
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233498db' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    transition: var(--transition);
}

#post-category:focus {
    outline: none;
    box-shadow: var(--shadow-hover);
}

.editor-container {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 25px;
    transition: var(--transition);
}

.editor-container:hover {
    box-shadow: var(--shadow-hover);
}

.editor-header {
    background: linear-gradient(to right, rgba(52, 152, 219, 0.05), rgba(46, 204, 113, 0.05));
    padding: 15px 20px;
    border-bottom: 1px solid #f0f4f8;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.editor-tools {
    display: flex;
    gap: 10px;
}

.editor-tools button {
    background: white;
    border: 1px solid #e0e6ed;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
}

.editor-tools button:hover {
    background: #f8f9fa;
    border-color: #d0d9e4;
}

.editor-tools button i {
    color: var(--primary);
}

#editor {
    border-radius: 0 0 var(--radius) var(--radius);
    overflow: hidden;
}

.btn-container {
    display: flex;
    justify-content: center;
    margin-top: 30px;
    gap: 20px;
}

.btn-submit {
    background: linear-gradient(to right, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.1rem;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow);
}

.btn-submit:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    opacity: 0.95;
}

.btn-draft {
    background: white;
    color: var(--dark);
    border: 1px solid #ddd;
}

.btn-draft:hover {
    background: #f8f9fa;
}

/* 页脚样式 */
footer {
    background: var(--dark);
    color: white;
    padding: 60px 0 20px;
    margin-top: 80px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-bottom: 30px;
}

.footer-column h3 {
    margin-bottom: 20px;
    font-size: 1.2rem;
    position: relative;
    padding-bottom: 10px;
}

.footer-column h3:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    border-radius: 2px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: #bdc3c7;
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-links a:hover {
    color: white;
    transform: translateX(5px);
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #bdc3c7;
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 900px) {
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }

    nav ul {
        gap: 10px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .create-post-header h1 {
        font-size: 2rem;
    }

    .btn-container {
        flex-direction: column;
    }
}

@media (max-width: 600px) {
    .footer-content {
        grid-template-columns: 1fr;
    }

    .editor-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .editor-tools {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 10px;
    }
}

/* 动画效果 */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
